package com.xhlj.controller;


import com.xhlj.utils.ChatAI;
import com.xhlj.utils.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("chat")
public class ChatController {

    @GetMapping()
    public Result test_chatGPT(@RequestParam("question") String question) throws IOException {
        return ChatAI.answer(question);
//        return Result.ok(123);6
    }
}
